import axios from "axios";
const instance = axios.create({

  //也可以配置在自定义的配置文件中
  baseURL: 'http://localhost:8089',
  timeout: 50000,
});



// axios请求拦截
instance.interceptors.request.use(configs => {
  // conifg.headers.token = window.sessionStorage.getItem('token')
  configs.headers.token = window.sessionStorage.getItem('token')
  console.log(configs.headers.token);
  return configs;
})

// axios响应拦截
instance.interceptors.response.use(configs => {
  return configs.data;
})

// const esRequest = axios.create({
//   baseURL: process.env.VUE_APP_ES_URL,
//   timeout: 5000
// })
export {instance}
// export {esRequest}
